var HTTP_TEST_BASE_URL = true ? 'http://localhost:8089/api/' : '',
    a = ['/account', '/event', '/activity', '/friends', '/artical'],
    [api_account, api_event, api_activity, api_friends, api_artical] = a.map(_ => HTTP_TEST_BASE_URL + _)

const serverAssetsRoot = 'http://localhost:8089/'

// 后端错误码字典
const error_code_map = new Map([
    [501, {
        action: 'alert',
        message: '数据库写入出错'
    }],
    [502, {
        action: 'alert',
        message: '文件写入时出错'
    }],
    [503, {
        action: 'alert',
        message: '数据库查找时出错'
    }],
    [504, {
        action: 'alert',
        message: '数据库删除时出错'
    }],
    [50000, {
        action: 'alert',
        message: '服务繁忙'
    }],
    [50001, {
        action: 'hint',
        message: '账号尚未注册' // 未注册账号登陆时
    }],
    [50002, {
        action: 'hint',
        message: '账号已经注册' // 已注册账号注册时
    }],
    [50003, {
        action: 'hint',
        message: '密码错误' // 登陆时密码错误
    }],
    [500010, { // 无权限访问
        action: 'redirect',
        path: '/account/login'
    }],
    [500011, {
        action: 'redirect',
        path: '/'
    }]
])

export {
    HTTP_TEST_BASE_URL,
    error_code_map,
    api_event, api_account, api_activity, api_friends, api_artical,
    serverAssetsRoot
}
